//
// Created on 2024/4/29.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef DIANPING_CAPI_DEMO_FLOWITEMNODE_H
#define DIANPING_CAPI_DEMO_FLOWITEMNODE_H

#include "nodes/ArkUINode.h"

class FlowItemNodeDelegate {
public:
    virtual ~FlowItemNodeDelegate() = default;
    virtual void onClick(){};
};

class FlowItemNode : public ArkUINode {
protected:
    FlowItemNodeDelegate *m_flowItemNodeDelegate;

public:
    FlowItemNode();
    ~FlowItemNode() override;

    void insertChild(ArkUINode &child, std::size_t index);
    void removeChild(ArkUINode &child);
    void onNodeEvent(ArkUI_NodeEventType eventType, EventArgs &eventArgs) override;
    void setFlowItemNodeDelegate(FlowItemNodeDelegate *flowItemNodeDelegate);
    void onClick();
    FlowItemNode &setMargin(float left, float top, float right, float bottom);
    FlowItemNode &setAlign(int32_t align);
};

#endif //DIANPING_CAPI_DEMO_FLOWITEMNODE_H
